package cmd

import (
	"os"

	"gitee.com/huangxinbo/xcas/cmd/api"
	"gitee.com/huangxinbo/xcas/cmd/app"
	"gitee.com/huangxinbo/xcas/cmd/asynq"
	"gitee.com/huangxinbo/xcas/cmd/asynqmon"
	"gitee.com/huangxinbo/xcas/cmd/version"
	"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{}

func init() {
	rootCmd.AddCommand(app.StartCmd)
	rootCmd.AddCommand(asynq.StartCmd)
	rootCmd.AddCommand(asynqmon.StartCmd)
	rootCmd.AddCommand(api.StartCmd)
	rootCmd.AddCommand(version.StartCmd)
}

func Execute() {
	if err := rootCmd.Execute(); err != nil {
		os.Exit(-1)
	}
}
